export type RepoContentApi = {
    name: string;
    path: string;
    sha: string;
    size: number;
    url: string;
    html_url: string;
    git_url: string;
    download_url: string | null;
    type: string;
    _links: {
        self: string;
        git: string;
        html: string;
    };
};

export type RepoContentModel = {
    name: string;
    path: string;
    sha: string;
    url: string;
    htmlUrl: string;
    downloadUrl: string | null;
    type: string;
};

export const normalizeRepoContent = (from: RepoContentApi[]): RepoContentModel[] =>
    from.map((elem) => ({
        ...elem,
        htmlUrl: elem.html_url,
        downloadUrl: elem.download_url,
    }));
